/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rcs.filesystem;

import org.rcs.folders.ItemsFactory;
import org.rcs.folders.VirtualItem;
import org.rcs.servlets.utils.XMLConfig;

/**
 *
 * @author rubén
 */
public class FileItemsFactory implements ItemsFactory {

  private FileItemsFactoryConfig config;

  public FileItemsFactory() {
  }

  @Override
  public void init() {
  }

  @Override
  public void destroy() {
  }
  
  @Override
  public String getName() {
    return getConfig().getName();
  }

  @Override
  public boolean isEnabled() {
    return getConfig().isEnabled();
  }

  @Override
  public VirtualItem[] getVideoItemsRoot() {
    return getConfig().getVideoItems();
  }

  @Override
  public VirtualItem[] getAudioItemsRoot() {
    return getConfig().getAudioItems();
  }

  @Override
  public VirtualItem[] getPictureItemsRoot() {
    return getConfig().getPictureItems();
  }

  private FileItemsFactoryConfig getConfig() {
    config = XMLConfig.get(config, FileItemsFactoryConfig.class) ;

    return config;
  }
}
